package com.dfbz.demo02_InputStream;

import java.io.FileInputStream;
import java.io.InputStream;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo06_使用偏移量来读取数据 {
    public static void main(String[] args) throws Exception {

        InputStream is = new FileInputStream("001.txt");


        byte[] data = new byte[6];
        int len = is.read(data,2,3);

        System.out.println(new String(data));           // abcd
        System.out.println(len);                        // 3

        is.close();

    }
}
